package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.BonusPoint;
import cn.wolfcode.trip.base.service.IBonusPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("bonuspoints")
public class BonusPointController {

    @Autowired
    private IBonusPointService bonusPointService;

    @GetMapping("/{id}")
    public Object  getPointByUserId(@PathVariable Long id){
        return bonusPointService.getPointByUserId(id);
    }

    @PostMapping
    public void updateBonusPoint(BonusPoint point){
        bonusPointService.updateBonusPoint(point);
    }

}
